// src/api/count.js
import axios from 'axios';

const apiClient = axios.create({
  baseURL: 'http://localhost:9205', // 直接指定后端地址
});
export function fetchDepartments() {
  return apiClient.get('/api/departments');
}

export function fetchProfitAnalysis(departmentId, startDate, endDate, granularity) {
  return apiClient.get('/api/profit-analysis', {
    params: {
      departmentId,
      startDate,
      endDate,
      granularity
    }
  });
}
